package com.zrrd._0727.重定向;
import java.io.*;
import java.util.Scanner;

public class TestSet {
      public static void main(String[] args) throws IOException {
//            PrintStream ps=new PrintStream(
//                    new FileOutputStream("yuan.txt"));
//            System.setOut(ps);//把所有东西输入到在ps这个包装类的文件，也就是"yuan.txt"
//            System.out.println("Alien Shooter");
            Func();
      }

      public static void Func() throws IOException {
            FileInputStream fis=new FileInputStream("new.txt");
            System.setIn(fis);
            Scanner scanner=new Scanner(System.in);
            while(scanner.hasNext()){
                  System.out.println(scanner.next());
            }
            fis.close();
      }
}
